﻿using Abp.Application.Services.Dto;
using Abp.Domain.Repositories;
using Abp.Domain.Services;
using System;
using System.Linq;
using System.Linq.Dynamic;

namespace LeadThing.AbpZeroTemplate.PersonTypes
{
    /// <summary>
    /// 人员类别业务管理
    /// </summary>
    public class PersonTypeManage : IDomainService
    {
        private readonly IRepository<PersonType, long> _personTypeRepository;

        /// <summary>
        /// 构造方法
        /// </summary>
        public PersonTypeManage(IRepository<PersonType, long> personTypeRepository)
        {
            _personTypeRepository = personTypeRepository;
        }

        //TODO:编写领域业务代码

        /// <summary>
        /// 获取全部人员分类
        /// </summary>
        /// <returns></returns>
        public ListResultDto<PersonType> GetAllPersonTypeList()
        {
            var query = _personTypeRepository.GetAll();
            var items = query.ToList();

            return new ListResultDto<PersonType>(items);
        }


        /// <summary>
        ///     初始化
        /// </summary>
        private void Init()
        {

        }
    }

}
